<?php

namespace app\index\controller;

use think\Db;

class Suggest extends Base
{
    public function addSuggest()
    {
        $data = [];

        input('cid') ? $data['cid'] = input('cid') : $this->err('缺少用户主键！');
        input('content') ? $data['content'] = input('content') : $this->err('缺少建议内容！');
        $data['status'] = 1; // 1-待解决
        $data['createTime'] = createTime();

        $res = model('suggest')->editData($data);
        $res ? $this->suc($res) : $this->err('提交失败！');

    }

}